package com.example.service.impl;

import ch.qos.logback.classic.Logger;
import com.example.entity.ElevatorType;
import com.example.mapp.ElevatorTypeMapp;
import com.example.service.ElevatorService;
import com.example.service.ElevatorTypeService;
import com.example.util.ResultUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by youkun on 2017/10/11.
 *
 */
@Service
public class ElevatorTypeServiceImpl implements ElevatorTypeService{

    private final static Logger logger = (Logger) LoggerFactory.getLogger(ElevatorServiceImpl.class);

    @Autowired
   private ElevatorTypeMapp elevatorTypeMapp;

    @Override
    public Map<String, Object> queryElevatorTypeList() {
        List<ElevatorType> list =null;
        Map<String,Object> map = new HashMap<String,Object>();
        try {
            list = elevatorTypeMapp.queryList();
            map.put("list",list);
        } catch (Exception e) {
            logger.error(e.getMessage());
            return ResultUtil.returnError("查询失败"+e.getMessage(),null);
        }
        return ResultUtil.returnSuccess("查询成功",map);
    }
}
